import 'package:froom/froom.dart';
// ignore: unused_import
import 'package:get/get.dart';
// ignore: unused_import
import "../../lib/src/type_converter.dart";

// ignore: uri_has_not_been_generated
part 'bill.g.dart';

/// 账单实体 - 测试用
@Entity(tableName: 'bills')
class Bill {
  @PrimaryKey(autoGenerate: true)
  final int? id;

  @ColumnInfo(name: 'bill_no')
  final String billNo;

  @ColumnInfo(name: 'user_id')
  final int userId;

  @ColumnInfo(name: 'product_id')
  final int productId;

  final int quantity;

  @ColumnInfo(name: 'total_amount')
  final double totalAmount;

  final String status; // pending, paid, cancelled

  @ColumnInfo(name: 'created_at')
  final DateTime createdAt;

  @ColumnInfo(name: 'paid_at')
  final DateTime? paidAt;

  const Bill({
    this.id,
    required this.billNo,
    required this.userId,
    required this.productId,
    required this.quantity,
    required this.totalAmount,
    this.status = 'pending',
    required this.createdAt,
    this.paidAt,
  });
}
